package edu.kjxy.day01;

/**
 * 功能:多个线程同时访问，一定会出现非线程安全问题。
 * 通过在run方法前加入synchronized关键字，使多个线程在执行run方法时
 * 以排队的方式进行处理。
 * 作者:程序员欧阳子韩
 * 日期:2024/1/31 14:21
 */
public class RunTest5 {
    public static void main(String[] args) {
        MyThread5 myThread5 = new MyThread5();
        Thread a = new Thread(myThread5,"A");
        Thread b = new Thread(myThread5,"B");
        Thread c = new Thread(myThread5,"C");
        Thread d = new Thread(myThread5,"D");
        Thread e = new Thread(myThread5,"E");

        a.start();
        b.start();
        c.start();
        d.start();
        e.start();
    }
}
